//
//  CWCCostomCell.m
//  ChuanNews
//
//  Created by dllo on 16/4/21.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CWCCostomCell.h"
#import "BaseHeader.h"
@implementation CWCCostomCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageV = [[UIImageView alloc]init];
        [self.contentView addSubview:self.imageV];
        [_imageV release];
        self.titleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.titleLabel];
        self.titleLabel.font = [UIFont systemFontOfSize:20];
        self.titleLabel.numberOfLines = 0;
        [self.titleLabel sizeToFit];
        self.digestLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.digestLabel];
        self.digestLabel.textColor = [UIColor grayColor];
        self.digestLabel.font = [UIFont systemFontOfSize:14];
        
        [self jxl_setDayMode:^(UIView *view) {
            CWCCostomCell *cell = (CWCCostomCell *)view;
            cell.backgroundColor = [UIColor whiteColor];
            cell.contentView.backgroundColor = [UIColor whiteColor];
            cell.titleLabel.backgroundColor = [UIColor whiteColor];
            cell.titleLabel.textColor = [UIColor blackColor];
            cell.digestLabel.backgroundColor = [UIColor whiteColor];
            cell.digestLabel.textColor = [UIColor blackColor];
        } nightMode:^(UIView *view) {
            CWCCostomCell *cell = (CWCCostomCell *)view;
            cell.backgroundColor = [UIColor blackColor];
            cell.contentView.backgroundColor = [UIColor blackColor];
            cell.titleLabel.backgroundColor = [UIColor blackColor];
            cell.titleLabel.textColor = [UIColor whiteColor];
            cell.digestLabel.backgroundColor = [UIColor blackColor];
            cell.digestLabel.textColor = [UIColor whiteColor];        }];
    }
    return self;
}
-(void)layoutSubviews{
    [super layoutSubviews];
    self.imageV.frame = CGRectMake(5, 5, 120, 80);
    self.titleLabel.frame = CGRectMake(130, 10, WIDTH - 130, 80);
    self.digestLabel.frame = CGRectMake(5, 90, WIDTH, 30);
}
- (void)dealloc {
    [_imageV release];
    [_titleLabel release];
    [_digestLabel release];
    [super dealloc];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
